<?php

namespace app\common\model;

use think\Model;

class Apply extends Model
{
    protected $autoWriteTimestamp =true;
    protected $type = [
        'create_time'  =>  'timestamp:Y/m/d H:i:s',
        'update_time'  =>  'timestamp:Y/m/d H:i:s',
    ];
    
    public function pic(){
        return $this->hasMany('ApplyPic','apply_id','id');
    }
    
    public function user(){
        return $this->hasOne('Member','id','user_id');
    }
    
    public function getStatusAttr($val){
        $arr = [0=>'待审核',1=>'审核通过',-1=>'未通过'];
        return $arr[$val];
    }
    
    public function getTypeAttr($val){
        $arr = [1=>'申请成为商户',2=>'认证企业资质',3=>'同城购认证',4=>'全景认证'];
        return $arr[$val];
       
    }

}
